package com.ruoyi.index.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.index.dto.GoodsCategoryDto;
import com.ruoyi.index.service.GoodsCategoryService;
import com.ruoyi.index.mapper.GoodsCategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @author dell
 * @description 针对表【ml_goods_category(商品分类表)】的数据库操作Service实现
 * @createDate 2025-03-19 09:07:32
 */
@Service
public class GoodsCategoryServiceImpl extends ServiceImpl<GoodsCategoryMapper, GoodsCategoryDto>
        implements GoodsCategoryService{
    @Autowired
    private GoodsCategoryMapper goodsCategoryMapper;

    @Override
    public List<GoodsCategoryDto> selectGoodsCategory(Integer isActive) {
        QueryWrapper<GoodsCategoryDto> qr = new QueryWrapper<>();
        qr.eq("is_active",isActive);
        return goodsCategoryMapper.selectList(qr);
    }

    @Override
    public GoodsCategoryDto selectGoodsCategoryId(Integer categoryId) {
        return goodsCategoryMapper.selectGoodsCategoryId(categoryId);
    }

    @Override
    public List<GoodsCategoryDto> selectLikeGoodsCategory(String goodsName) {
        return goodsCategoryMapper.selectLikeGoodsCategory(goodsName);
    }
}




